/**
 * Created by zhengsenwen on 2017/8/24.
 */

loadMealTime();

/**
 * 加载现在的餐次（早餐、午餐、晚餐）  例如：晚餐
 */
function loadMealTime() {

    setTimeout(function () {
        $.ajax({
            type: 'get',
            url: '/common/mealtime',
            async: true,
            data: new Date(),
            contentType: 'application/json;charset=utf-8',
            timeout: 10000,
            success: function (data) {
                $(".dishes_sign #mealtime").text('今日' + data + '菜品');
            },
            error: function () {
                alert("失败，请稍后再试！");
            }
        });
    }, 500);

    setTimeout(function () {
        $.ajax({
            type: 'get',
            url: '/common/mealtime',
            async: true,
            data: new Date(),
            contentType: 'application/json;charset=utf-8',
            timeout: 10000,
            beforeSend: function () {
                $(".dishes_sign #mealtime").text("");
            },
            success: function (data) {
                $(".dishes_sign #mealtime").text('今日' + data + '菜品');
            },
            error: function () {
                alert("失败，请稍后再试！");
            }
        });
    }, 1000 * 60 * 30)

}